package com.haixiaoke.saas.repository.mapper;

import com.haixiaoke.saas.repository.pojo.OrderOperatingRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单记录Mapper接口
 * 
 * @author haixiaoke
 * @date 2023-04-12
 */
@Mapper
public interface OrderOperatingRecordMapper {
    /**
     * 查询订单记录
     * 
     * @param orderRecordId 订单记录主键
     * @return 订单记录
     */
    OrderOperatingRecord selectOrderOperatingRecordByOrderRecordId(Long orderRecordId);

    /**
     * 查询订单记录列表
     * 
     * @param orderOperatingRecord 订单记录
     * @return 订单记录集合
     */
    List<OrderOperatingRecord> selectOrderOperatingRecordList(OrderOperatingRecord orderOperatingRecord);

    /**
     * 新增订单记录
     * 
     * @param orderOperatingRecord 订单记录
     * @return 结果
     */
    int insertOrderOperatingRecord(OrderOperatingRecord orderOperatingRecord);

    /**
     * 修改订单记录
     * 
     * @param orderOperatingRecord 订单记录
     * @return 结果
     */
    int updateOrderOperatingRecord(OrderOperatingRecord orderOperatingRecord);

    /**
     * 删除订单记录
     * 
     * @param orderRecordId 订单记录主键
     * @return 结果
     */
    int deleteOrderOperatingRecordByOrderRecordId(Long orderRecordId);

    /**
     * 批量删除订单记录
     * 
     * @param orderRecordIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteOrderOperatingRecordByOrderRecordIds(Long[] orderRecordIds);

    /**
     * 根据订单id查询订单异常记录
     * @param orderId   订单id
     * @return
     */
    List<OrderOperatingRecord> getRecordByOrderId(Long orderId);

    OrderOperatingRecord selectOperatingOrderCancel(@Param("orderId") String orderId,@Param("orderState") Integer orderState,@Param("orderStateUnPayment") Integer orderStateUnPayment);

    void deleteOrderOperatingRecordByOrderId(String orderId);

    OrderOperatingRecord selectOrderOperatingRecordByOrderId(String orderId);

    OrderOperatingRecord selectOrderOperatingRecordByOrderIdAndOperatingType(@Param("orderId")String orderId,@Param("operatingType") Integer operatingType);
}
